package net.e20blueprint.android.cuckobee;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TextView;

public class CuckobeeHome extends TabActivity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        try { 
        	setTabs();
        } catch (Throwable e ) {
        	setContentView(R.layout.error);
        	TextView text = (TextView)findViewById(R.layout.error);
        	text.setText("Error");
        }
    }

	
	private void setTabs() throws Exception {
	    TabHost tabHost = getTabHost(); // The activity TabHost
	    TabHost.TabSpec spec;  			// Resusable TabSpec for each tab	

        Intent intent = new Intent().setClass(this, CharacterPage.class);

	    // Initialize a TabSpec for each tab and add it to the TabHost
	    spec = tabHost.newTabSpec("Character");
	    spec.setIndicator("Character");
	    spec.setContent(intent);
	    tabHost.addTab(spec);
	    
        intent = new Intent().setClass(this, TalentsPage.class);
	    spec = tabHost
				.newTabSpec("Talents")
				.setIndicator("Talents")
				.setContent(intent);
	    tabHost.addTab(spec);
	    
	    //tabHost.setCurrentTab(1);
	}
}